package fun.yyds.controller.sys;

import fun.yyds.common.ResponseData;
import fun.yyds.service.sys.SysService;

import fun.yyds.service.sys.UdpService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@Tag(name = "1.Sys")
@RequestMapping("/sys")
public class SysController {
    @Resource
    private SysService sysService;

    @Resource
    private UdpService udpService;

    @GetMapping("/version")
    @Operation(summary ="版本号")
    public ResponseData GetVersion() {
        return ResponseData.success(sysService.version());
    }

    @GetMapping("/upd/send")
    @Operation(summary ="udp")
    public ResponseData setUdp(@RequestParam String json) {
        udpService.send(json);
        return ResponseData.success();
    }


}
